#include "my_spin.h"

My_spin::My_spin(const QString &title, QWidget *parent) : QWidget(parent)
{
    name = new QLabel(title, this);
    name->setAlignment(Qt::AlignCenter);
    spin = new QDoubleSpinBox(this);
    spin->setAlignment(Qt::AlignCenter);
    box = new QHBoxLayout();
    box->addWidget(name);
    box->addWidget(spin);
    box->setContentsMargins(LEFT_M, TOP_M, RIGHT_M, BOTTOM_M);
    box->setSpacing(SPACE_SON);
    this->setLayout(box);
}

void My_spin::setSingleStep(double val)
{
    spin->setSingleStep(val);
}

void My_spin::setMinimum(double val)
{
    spin->setMinimum(val);
}

double My_spin::value()
{
    return spin->value();
}
